Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-pseudo-class-any-link

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-pseudo-class-any-link

Use the :any-link pseudo-class in CSS

  • 5.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.5M
increased by0.94%
Maintainers
1
Weekly downloads
 
Created
Source

NPM Version CSS Standard Status Build Status Windows Build Status Support Chat

PostCSS Pseudo Class Any Link lets you :any-link pseudo-class in CSS, following the Selectors specification.

nav :any-link > span {
  background-color: yellow;
}

/* becomes */

nav :link > span, nav :visited > span {
  background-color: yellow;
}

nav :any-link > span {
  background-color: yellow;
}

From the proposal:

The :any-link pseudo-class represents an element that acts as the source anchor of a hyperlink. It matches an element if the element would match :link or :visited.

Usage

Add PostCSS Pseudo Class Any Link to your build tool:

npm install postcss-pseudo-class-any-link --save-dev
Node

Use PostCSS Pseudo Class Any Link to process your CSS:

import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link';

postcssPseudoClassAnyLink.process(YOUR_CSS, /* processOptions */, /* pluginOptions */);
PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Use PostCSS Pseudo Class Any Link as a plugin:

import postcss from 'gulp-postcss';
import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link';

postcss([
  postcssPseudoClassAnyLink(/* pluginOptions */)
]).process(YOUR_CSS);
Webpack

Add PostCSS Loader to your build tool:

npm install postcss-loader --save-dev

Use PostCSS Pseudo Class Any Link in your Webpack configuration:

import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link';

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'style-loader',
          { loader: 'css-loader', options: { importLoaders: 1 } },
          { loader: 'postcss-loader', options: {
            ident: 'postcss',
            plugins: () => [
              postcssPseudoClassAnyLink(/* pluginOptions */)
            ]
          } }
        ]
      }
    ]
  }
}
Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Use PostCSS Pseudo Class Any Link in your Gulpfile:

import postcss from 'gulp-postcss';
import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link';

gulp.task('css', () => gulp.src('./src/*.css').pipe(
  postcss([
    postcssPseudoClassAnyLink(/* pluginOptions */)
  ])
).pipe(
  gulp.dest('.')
));
Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Use PostCSS Pseudo Class Any Link in your Gruntfile:

import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link';

grunt.loadNpmTasks('grunt-postcss');

grunt.initConfig({
  postcss: {
    options: {
      use: [
       postcssPseudoClassAnyLink(/* pluginOptions */)
      ]
    },
    dist: {
      src: '*.css'
    }
  }
});

Options

preserve

The preserve option determines whether the original :any-link rule is preserved. By default, it is preserved.

postcssPseudoClassAnyLink({ preserve: false })
nav :any-link > span {
  background-color: yellow;
}

/* becomes */

nav :link > span, nav :visited > span {
  background-color: yellow;
}

Keywords

FAQs

Package last updated on 08 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc